package com.mxsoft.mpdemo.web;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.mxsoft.mpdemo.model.User;
import com.mxsoft.mpdemo.service.IUserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 系统用户表 前端控制器
 * </p>
 *
 * @author alex
 * @since 2017-12-13
 */
@RestController
@RequestMapping("/mpdemo/user")
public class UserController {

    @Autowired
    private IUserService userService;

    @ApiOperation("查询用户列表")
    @RequestMapping
    public ResponseEntity<List<User>> index() {
        List<User> userList = userService.selectList(new EntityWrapper<User>().eq("name", "alex"));
        return new ResponseEntity<>(userList, HttpStatus.OK);
    }

}

